import requests
import lxml.etree as le
import openpyxl

url = 'https://www.runoob.com/html/html-tutorial.html'

content = requests.get(url = url).content

contentx = le.HTML(content)

categorys = contentx.xpath('//div[@id="leftcolumn"]/a/text()')
file = openpyxl.Workbook()
sheet = file.active
sheet.title = "data"
i = 0
for category in categorys:
    category = category.strip()
    for index in range(len(category)):
        sheet.cell(i + 1, index + 1, category[index])
    i = i + 1
   
file.save("category.xlsx")











